package wta.cloud.dao;

import java.util.List;

import javax.annotation.Resource;

import org.hibernate.SessionFactory;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import wta.cloud.entity.Cancer;

@SuppressWarnings("unused")
@Transactional
@Repository
public class CancerDao {
	@Resource
	private SessionFactory sessionFactory;

	public Cancer getCancer(String uid) {
		return (Cancer)sessionFactory.getCurrentSession().get(Cancer.class, uid);
	}
	
	@SuppressWarnings("unchecked")
	public List<Cancer> getAll() {
		return sessionFactory.getCurrentSession().createQuery("from cancer").list();
	}
}
